<template>
  <div class="app-container" style="font-size:12px">
      <el-table :key="tableKey" v-loading="listLoading" :data="first_data" size="mini" border fit highlight-current-row style="width: 100%;">
          <el-table-column label="时间维度" align="center" >
            <template slot-scope="{row}">
              <span>{{ row.month }}</span>
            </template>
          </el-table-column>

          <el-table-column label="C" align="center">
            <template slot-scope="{row}">
              <span>{{ row.total_money0 }}</span>
            </template>
          </el-table-column>

          <el-table-column label="M1" align="center">
            <template slot-scope="{row}">
              <span>{{ row.total_money1 }}</span>
            </template>
          </el-table-column>

          <el-table-column label="M2" align="center">
            <template slot-scope="{row}">
              <span>{{ row.total_money2 }}</span>
            </template>
          </el-table-column>

          <el-table-column label="M3" align="center">
            <template slot-scope="{row}">
              <span>{{ row.total_money3 }}</span>
            </template>
          </el-table-column>
          <el-table-column label="M4" align="center">
            <template slot-scope="{row}">
              <span>{{ row.total_money4 }}</span>
            </template>
          </el-table-column>
          <el-table-column label="M5" align="center">
            <template slot-scope="{row}">
              <span>{{ row.total_money5 }}</span>
            </template>
          </el-table-column>
          <el-table-column label="M6" align="center">
            <template slot-scope="{row}">
              <span>{{ row.total_money6 }}</span>
            </template>
          </el-table-column>
          <el-table-column label="M7+" align="center">
            <template slot-scope="{row}">
              <span>{{ row.total_money7 }}</span>
            </template>
          </el-table-column>
          <el-table-column label="C-M1" align="center">
            <template slot-scope="{row}">
              <span>{{ row.rate1 }}%</span>
            </template>
          </el-table-column>
          <el-table-column label="M1-M2" align="center">
            <template slot-scope="{row}">
              <span>{{ row.rate2 }}%</span>
            </template>
          </el-table-column>
          <el-table-column label="M2-M3" align="center">
            <template slot-scope="{row}">
              <span>{{ row.rate3 }}%</span>
            </template>
          </el-table-column>
          <el-table-column label="M3-M4" align="center">
            <template slot-scope="{row}">
              <span>{{ row.rate4 }}%</span>
            </template>
          </el-table-column>
          <el-table-column label="M4-M5" align="center">
            <template slot-scope="{row}">
              <span>{{ row.rate5 }}%</span>
            </template>
          </el-table-column>
          <el-table-column label="M5-M6" align="center">
            <template slot-scope="{row}">
              <span>{{ row.rate6 }}%</span>
            </template>
          </el-table-column>

          
          
      </el-table>
  </div>
</template>

<script>
import {
  getGoodsMigrateData
} from '@/api/finance_excel'
import waves from '@/directive/waves' // waves directive

import Pagination from '@/components/Pagination' // secondary package based on el-pagination
export default {
  name: 'ReceiveTable',
  components: {
    Pagination
  },
  directives: {
    waves
  },
  data() {
    return {
      listLoading: true,
      tableKey: 0,
      activeName: 'first',
      first_data:[],
    }
  },

  created(){
    this.getGoodsMigrateData()
  },
  methods: {
   
    //数据
    getGoodsMigrateData(){
      getGoodsMigrateData().then(response => {
        this.listLoading = false
        this.first_data = response.data
      })
    },
   
    //导出
    excelout() {
      merchantdayexcelout(this.infoQuery).then(response => {
        this.listLoading = false
        const filepath = response.data.path
        window.location.href = filepath
      })
    },

  }
}
</script>

<style>
</style>
